﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DelStoragePage1.aspx.cs" Inherits="DelStorage_DelStoragePage1" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>正贸仓储物流管理系统</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript">
    <!--
        function SelectAllCheckBox(obj) {
            var gvStock = document.getElementById('<%=gvStock.ClientID %>');
            if (gvStock == null)
                return;
            for (i = 0; i < gvStock.rows.length - 1; i++) {

                if (i < 8) {
                    strID = "gvStock_ctl0" + (i + 2) + "_chkSelect";
                }
                else {
                    strID = "gvStock_ctl" + (i + 2) + "_chkSelect";
                }
                if (obj.checked) {
                    document.getElementById(strID).checked = true;
                }
                else {
                    document.getElementById(strID).checked = false;
                }
            }
        }

        function SelectAllCheckBox1(obj) {

            var gvStorage = document.getElementById('<%=gvStorage.ClientID %>');
            if (gvStorage == null)
                return;
            for (i = 0; i < gvStorage.rows.length - 1; i++) {

                if (i < 8) {
                    strID = "gvStorage_ctl0" + (i + 2) + "_chkSelect";
                }
                else {
                    strID = "gvStorage_ctl" + (i + 2) + "_chkSelect";
                }
                if (obj.checked) {
                    document.getElementById(strID).checked = true;
                }
                else {
                    document.getElementById(strID).checked = false;
                }
            }
        }
        -->
    </script>

    <script type="text/javascript" src="../js/WdatePicker.js"></script>

</head>
<body>
    <form id="form1" runat="server">
     <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    <div>
       
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td style="height: 30px">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_03.gif); background-repeat: repeat-x;
                                width: 12px;">
                                &nbsp;
                            </td>
                            <td style="background-image: url(../images/tab_05.gif); background-repeat: repeat-x;
                                height: 30px;">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 46%; vertical-align: middle;">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td style="width: 5%; vertical-align: middle;">
                                                        <img src="../images/tb.gif" width="16" height="16" />
                                                    </td>
                                                    <td style="width: 95%;">
                                                        <span>你当前的位置</span>：业务管理-出库管理
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="54%">
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="16" style="background-image: url(../images/tab_07.gif); height: 30px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_12.gif); width: 8px;">
                                &nbsp;
                            </td>
                            <td>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                                    <tr>
                                        <td style="padding: 2px; width: 100%">
                                            <table width="100%" cellspacing="0" cellpadding="0" border="1" bordercolordark="#ffffff"
                                                bordercolorlight="#b5d6e6">
                                                <tr>
                                                    <td >
                                                        单据时间(起)：
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtCDTS" runat="server" Style="width: 130px; height: 14px; border: solid 1px #b5d6e6;
                                                            font-size: 9pt;" onfocus="new WdatePicker(this)"></asp:TextBox>
                                                    </td>
                                                    <td >
                                                        单据时间(讫)：
                                                    </td>
                                                    <td >
                                                        <asp:TextBox ID="txtCDTE" runat="server" Style="width: 130px; height: 14px; border: solid 1px #b5d6e6;
                                                            font-size: 9pt;" onfocus="new WdatePicker(this)"></asp:TextBox>
                                                    </td>
                                                     <td >
                                                        单据号：
                                                    </td>
                                                    <td >
                                                        <asp:TextBox ID="txtStockNo" runat="server" Style="width: 130px; height: 14px; border: solid 1px #b5d6e6;
                                                            font-size: 9pt;" ></asp:TextBox>
                                                    </td>
                                                    <td >
                                                        <asp:ImageButton ID="ibtnSearch" runat="server" ImageUrl="~/Images/btn/btn_Search.gif"
                                                            OnClick="ibtnSearch_Click" />&nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding: 2px">
                                            <%-- <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 337px; overflow-x: auto;
                                                overflow-y: auto;">--%>
                                            <table style="width: 100%; height: 100%">
                                                <tr>
                                                    <td valign="top" style="width: 20%">
                                                        <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 150px; overflow-x: auto;
                                                            overflow-y: auto;">
                                                            <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                                                            <ContentTemplate>
                                                            <asp:GridView ID="gvStock" runat="server" AutoGenerateColumns="false" Width="99%"
                                                                BorderWidth="1px" BorderColor="#B5D6E6" CellPadding="0" DataKeyNames="StockNo"
                                                                AllowPaging="false" OnRowDataBound="gvStock_RowDataBound">
                                                                <Columns>
                                                                    <asp:TemplateField>
                                                                        <HeaderTemplate>
                                                                            <input id="hchkSelect" type="checkbox" onclick="SelectAllCheckBox(this)" />
                                                                        </HeaderTemplate>
                                                                        <ItemTemplate>
                                                                            <asp:CheckBox ID="chkSelect" runat="server" />
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="8%" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="序号">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="LabNumber" runat="server" Text="<%#Container.DataItemIndex+1%>"></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="30%" HorizontalAlign="Center" />
                                                                    </asp:TemplateField>
                                                                    <%--  <asp:BoundField DataField="StockNo" HeaderText="出库单号">
                                                            <ItemStyle Width="50" HorizontalAlign="Center" />
                                                        </asp:BoundField>--%>
                                                                    <asp:TemplateField HeaderText="出库单号">
                                                                        <ItemTemplate>
                                                                            <asp:LinkButton ID="lbtn_StockNo" runat="server" Text='<%# Bind("StockNo") %>' ForeColor="Blue"
                                                                                CommandArgument='<%# Bind("StockNo") %>'></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="60%" />
                                                                    </asp:TemplateField>
                                                                </Columns>
                                                                <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                                <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                            </asp:GridView>
                                                            </ContentTemplate>
                                                            </asp:UpdatePanel>
                                                        </div>
                                                    </td>
                                                    <td valign="top" style="width: 80%">
                                                        <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 150px; overflow-x: auto;
                                                            overflow-y: auto;">
                                                            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                                            <ContentTemplate>
                                                            <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" Width="99%" BorderWidth="1px"
                                                                BorderColor="#B5D6E6" CellPadding="0" DataKeyNames="PID" AllowPaging="false"
                                                                OnRowDataBound="gv_RowDataBound" AutoGenerateSelectButton="True" 
                                                                onselectedindexchanged="gv_SelectedIndexChanged">
                                                                <Columns>
                                                                    <asp:TemplateField HeaderText="序号">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="LabNumber" runat="server" Text="<%#Container.DataItemIndex+1%>"></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="8%" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="物料名称">
                                                                        <ItemTemplate>
                                                                            <asp:LinkButton ID="lbtn_Mat_Name" runat="server" Text='<%# Bind("Mat_Name") %>'
                                                                                ForeColor="Blue" CommandArgument='<%# Bind("Mat_Code") %>'></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="30%" />
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="Mat_Code" HeaderText="物料编码">
                                                                        <ItemStyle Width="20%" HorizontalAlign="Center" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="Num" HeaderText="出库数量">
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="Act_Num" HeaderText="已出数量">
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="PID" HeaderText="PID">
                                                                        <ItemStyle Width="15%" />
                                                                    </asp:BoundField>
                                                                </Columns>
                                                                <SelectedRowStyle BackColor="#99CCFF" />
                                                                <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                                <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                            </asp:GridView>
                                                            </ContentTemplate>
                                                            </asp:UpdatePanel>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                            <%--   </div>--%>
                                        </td>
                                    </tr>
                                     <tr>
                                        <td style="padding: 2px">
                                            <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 150px; overflow-x: auto;
                                                overflow-y: auto;">
                                                <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                                <ContentTemplate>
                                                <asp:GridView ID="gvStorage" runat="server" AutoGenerateColumns="False" Width="100%"
                                                    AllowPaging="false" DataKeyNames="PID,delPID">
                                                    <Columns>
                                                        <asp:TemplateField>
                                                            <HeaderTemplate>
                                                                <input id="hchkSelect" type="checkbox" onclick="SelectAllCheckBox1(this)" />
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:CheckBox ID="chkSelect" runat="server" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="10" />
                                                        </asp:TemplateField>
                                                        
                                                      <asp:BoundField DataField="Mat_Name" HeaderText="物料名称">
                                                          <%--  <ItemStyle Width="50" />--%>
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="Zone_Name" HeaderText="库区类型">
                                                         <%--   <ItemStyle Width="50" />--%>
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="Pos_ID" HeaderText="货位号">
                                                          <%--  <ItemStyle Width="50" />--%>
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="Mat_Num" HeaderText="库存数量">
                                                            <ItemStyle Width="100" />
                                                        </asp:BoundField>
                                                       
                                                        <asp:TemplateField HeaderText="出库数量">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="txtNum" runat="server" Width="100" Text='<%# Bind("Num")%>'></asp:TextBox>
                                                            </ItemTemplate>
                                                            <ItemStyle Width="10%" />
                                                        </asp:TemplateField>
                                                     <asp:TemplateField HeaderText="PID" Visible="false">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_Mat_Code" runat="server" Text='<%# Bind("Mat_Code") %>'></asp:Label>
                                                                <asp:Label ID="lab_Tray_ID" runat="server" Text='<%# Bind("Tray_ID") %>' ></asp:Label>
                                                                <asp:Label ID="lab_ContainerID" runat="server" Text='<%# Bind("ContainerID") %>'></asp:Label>
                                                                <asp:Label ID="lab_SEC_MAT_ID" runat="server" Text='<%# Bind("SEC_MAT_ID") %>' ></asp:Label>
                                                                 <asp:Label ID="lbl_Num" runat="server" Text='<%# Bind("Num") %>' ></asp:Label>
                                                            </ItemTemplate>
                                                            <ItemStyle Width="10%" />
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="CDT" HeaderText="入库时间">
                                                            <ItemStyle Width="100" />
                                                        </asp:BoundField>
                                                    </Columns>
                                                    <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                    <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                </asp:GridView>
                                                </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="25" style="padding: 2px;">
                                            <table width="100%" cellspacing="0" cellpadding="0" border="1" bordercolordark="#ffffff"
                                                bordercolorlight="#b5d6e6">
                                                <tr>
                                                    <td style="padding-left: 4px; width: 150px; height: 25px;">
                                                        <asp:ImageButton ID="ibtnMerge" runat="server" ImageUrl="~/Images/btn/btn_HBCKD.gif"
                                                            OnClick="ibtnMerge_Click" />
                                                          
                                                    </td>
                                                    <td>
                                                      <asp:ImageButton ID="btn_CKDXF" runat="server" ImageUrl="~/Images/btn/btn_chukudanxiafa.gif"
                                                            OnClick="btn_CKDXF_Click" />  
                                                    </td>
                                                    <td style="padding-left: 4px; height: 25px;" align="right">
                                                        <font color="#ff0000"><b>
                                                            <asp:Label ID="Label1" runat="server"></asp:Label></b></font>
                                                        <asp:RadioButtonList ID="rbtnl_Zone" runat="server" RepeatDirection="Horizontal">
                                                            <asp:ListItem Value="1" Selected="True">立体库</asp:ListItem>
                                                            <asp:ListItem Value="2">回转库</asp:ListItem>
                                                        </asp:RadioButtonList>
                                                    </td>
                                                    <td style="padding-left: 4px; width: 200px; height: 25px;">
                                                        <asp:Label ID="Label2" runat="server" Text="选择终点设备："></asp:Label>
                                                        <asp:DropDownList ID="ddlSQIDE" runat="server">
                                                            <asp:ListItem Selected="True" Value="0">自动</asp:ListItem>
                                                            <asp:ListItem Value="139">139</asp:ListItem>
                                                            <asp:ListItem Value="239">239</asp:ListItem>
                                                            <asp:ListItem Value="126">126</asp:ListItem>
                                                            <asp:ListItem Value="326">326</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td style="padding-right: 4px; padding-top: 2px; width: 180px;" align="right">
                                                        <asp:ImageButton ID="ibt_reset" runat="server" ImageUrl="~/Images/btn/btn_Reset.gif"
                                                            OnClick="ibt_reset_Click" />&nbsp;
                                                        <asp:ImageButton ID="ibtn_jianxian" runat="server" ImageUrl="~/Images/btn/btn_InOut.gif"
                                                            OnClick="ibtn_jianxian_Click" ToolTip="在线拣选" />&nbsp;
                                                        <%--<asp:TemplateField HeaderText="选择">
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="ibtnIMG_Search" runat="server" CommandArgument='<%# Bind("Mat_Code") %>'
                                                                    ImageUrl="~/Images/33.gif" Style="height: 14px"  OnClick="ibtnIMG_Search_Click" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="5%" />
                                                        </asp:TemplateField>--%>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding: 2px;">
                                            <div style="margin-left: 0px; margin-top: 3px; width: 99.5%; height: 150px; overflow-x: auto;
                                                overflow-y: auto;">
                                                 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                            <ContentTemplate>
                                                <asp:GridView ID="gvDate" runat="server" AutoGenerateColumns="False" Width="99%"
                                                    BorderWidth="1px" BorderColor="#B5D6E6" CellPadding="0" DataKeyNames="PID" AllowPaging="false">
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="序号">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LabNumber" runat="server" Text="<%#Container.DataItemIndex+1%>"></asp:Label>
                                                            </ItemTemplate>
                                                            <ItemStyle Width="20" />
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="Mat_Name" HeaderText="物料名称">
                                                            <ItemStyle Width="30%" />
                                                        </asp:BoundField>
                                                         <asp:BoundField DataField="Pos_ID" HeaderText="货位号">
                                                            <ItemStyle Width="10%" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="Tray_ID" HeaderText="托盘号">
                                                            <ItemStyle Width="10%" />
                                                        </asp:BoundField>
                                                        <asp:TemplateField HeaderText="出库数量">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="txtNum" runat="server" Width="100" Text='<%# Bind("Out_Num") %>'></asp:TextBox>
                                                            </ItemTemplate>
                                                            <ItemStyle Width="30" />
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="Mat_Num" HeaderText="库存数量">
                                                            <ItemStyle Width="40" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="delPID" HeaderText="出库单明细PID">
                                                            <ItemStyle Width="20%" />
                                                        </asp:BoundField>
                                                        <asp:TemplateField HeaderText="PID" Visible="false">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_PID" runat="server" Text='<%# Bind("PID") %>'></asp:Label>
                                                                <asp:Label ID="lab_Tray_ID" runat="server" Text='<%# Bind("Tray_ID") %>' Visible="true"></asp:Label>
                                                                <asp:Label ID="lab_ContainerID" runat="server" Text='<%# Bind("ContainerID") %>'
                                                                    Visible="false"></asp:Label>
                                                                <asp:Label ID="lab_SEC_MAT_ID" runat="server" Text='<%# Bind("SEC_MAT_ID") %>' Visible="false"></asp:Label>
                                                                 <%--<asp:Label ID="lbl_Num" runat="server" Text='<%# Bind("N01") %>' ></asp:Label>--%>

                                                            </ItemTemplate>
                                                            <ItemStyle Width="10%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField>
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="ibtndelete" runat="server" CommandArgument='<%# Bind("Guid") %>'
                                                                    ImageUrl="~/Images/del.gif" Style="height: 16px" OnClick="ibtndelete_Click" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="5%" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                    <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                </asp:GridView>
                                                </ContentTemplate>
                                                            </asp:UpdatePanel>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="background-image: url(../images/tab_15.gif); width: 8px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="background-image: url(../images/tab_19.gif); height: 35px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="width: 12px; height: 35px;">
                                <img src="../images/tab_18.gif" width="12" height="35" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td width="16">
                                <img src="../images/tab_20.gif" width="16" height="35" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hidden" runat="server" />
        <asp:HiddenField ID="hiddenStock" runat="server" />
    </div>
    </form>
</body>
</html>

